Fetch Notification Feed
Notification feed is a great way to populate notifications for a user. You can achieve the same with LikeMinds iOS SDK, by following the steps given below.
Steps to fetch notification feed
- Create a GetNotificationFeedRequest object using
GetNotificationFeedRequest.builder()
class by passing all the required parameters. - Call
getNotificationFeed()
function using the instance ofLMFeedClient
. - Process the response LMResponse<GetNotificationFeedResponse> as per your requirement.
// object of GetNotificationFeedRequest
let request = GetNotificationFeedRequest.builder()
.page(1) // page number for paginated notification feed data
.pageSize(10) // page size for paginated notification feed data
.build()
LMFeedClient.shared.getNotificationFeed(request) { response in
// response (LMResponse<GetNotificationFeedResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
GetNotificationFeedRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
page | Int | Page number for paginated notification feed data. | |
pageSize | Int | Page size for paginated notification feed data. |
GetNotificationFeedResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
activities | Activity[] | List of activities inside notification feed. | |
users | [String: User] | Dictionary of UUID to user object. | |
topics | [String, Topic] | Map of topic id to topic object. |